- read        ||= false
- categories  = [params[:categories]].flatten.compact
- active      = categories.flatten.member?(category.label)

.category{id: dom_id(category)}
  - if read
    - active_class = active ? "active" : nil
    - categories = active ? categories.reject{|c| c == category.label} : categories << category.label
    - url = "?#{{categories: categories}.to_query}"
    = link_to category.label, url, class: "btn btn-sm btn-light btn-block text-left text-truncate #{active_class}"
  - else
    .btn-group.d-flex
      = link_to category.label, edit_comfy_admin_cms_site_category_path(@site, category), remote: true, class: "btn btn-sm btn-light w-100 text-left text-truncate"
      = link_to comfy_admin_cms_site_category_path(@site, category), method: :delete, remote: true, data: {confirm: t('.are_you_sure')}, class: 'btn btn-sm btn-danger', aria: {label: "Delete Category"} do
        %i.fas.fa-fw.fa-times
